package com.googlecode.continuity.plugin.codecomment.client;

import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.ui.FlexTable;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.googlecode.continuity.plugin.codecomment.client.message.CodeCommentMessages;
import com.googlecode.continuity.plugin.svnbrowser.client.SVNRepositoryHandle;

/**
 * CommentBox
 *
 * @author Peter Schmitt <aragos@aragos.de>
 */
abstract class CommentBox extends VerticalPanel {
// ------------------------------ FIELDS ------------------------------

  // using a flextable instead of verticalPanel so we can add styles to cells
  protected FlexTable content;
  protected CodeComment comment;
  protected SVNRepositoryHandle svnHandle;
  protected CodeCommentArea area;

  protected final CodeCommentMessages messages = (CodeCommentMessages) GWT.create(CodeCommentMessages.class);

// --------------------------- CONSTRUCTORS ---------------------------

  protected CommentBox(SVNRepositoryHandle svnHandle, CodeComment comment, CodeCommentArea area) {
    this.comment = comment;
    this.svnHandle = svnHandle;
    this.area = area;

    add(content = new FlexTable());

    addStyleName("commentBox");
    content.addStyleName("content");
    content.setWidth("100%");
  }

// --------------------- GETTER / SETTER METHODS ---------------------

  public CodeComment getComment() {
    return comment;
  }

  // -------------------------- OTHER METHODS --------------------------

  protected abstract boolean isEdited();
}
